import { createRouter, createWebHistory } from 'vue-router'
import home from '../views/home/index.vue'

const routes = [
    {
        path: '/',
        name: 'Home',
        component: home
    },
    {
        path: '/about',
        name: 'About',
        component: () => import('../views/home/index.vue')
    },
    {
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        component: () => import('../views/error/NotFound.vue')
    }
]

const router = createRouter({
    // 使用 createWebHistory() 启用 History 模式
    history: createWebHistory(),
    routes
})

export default router
